package io.github.eric.urpc.example.example;

import io.github.eric.urpc.example.SimpleClient;
import io.github.eric.urpc.example.SimpleServer;
import io.github.eric.urpc.example.msg.NotRegMsg;

public class SendNotRegMsgExample {
    public static void main(String[] args) {
        SimpleServer simpleServer = new SimpleServer();
        simpleServer.start();

        SimpleClient simpleClient = new SimpleClient();
        simpleClient.connectSync();

        int a = 1;
        while (true) {
            try {
                Thread.sleep(3000L);
            } catch (Exception ignore) {}
            simpleClient.getClient().sendAsync(new NotRegMsg(a++));
        }
    }
}
